package com.caigou.service;

import com.caigou.bean.cms.entity.Article;
import com.caigou.bean.cms.entity.ArticleKeyword;
import com.caigou.bean.cms.entity.ArticleStatistics;
import com.caigou.bean.cms.entity.ArticleStatisticsDay;
import com.caigou.bean.cms.param.*;
import com.caigou.bean.exam.entity.Users;
import com.caigou.bean.vo.ChannelTdkVO;
import com.caigou.bean.vo.KeyValueVO;
import com.caigou.pojo.*;
import com.caigou.util.Result;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;

public interface ArticleService {
    Result loadArticleReleaseChannelStatus(ArticleParam param);

    int loadArticleExist(String articleId);

    Result saveArticleData(ArticleParam param, Users users);

    Result<PageInfo<ArticleList>> loadArticleList(ArticleListParam param, Users users);

    Result<List<ArticleExportList>> loadArticleExportList(ArticleListParam param, Users users);

    Result<ArticleData> loadArticleData(ArticleDataParam param);

    Result saveArticleAdjunct(ArticleAdjunctDataParam param, Users users);

    Result deleteArticleAdjunct(ArticleAdjunctDataParam param);

    Result saveArticleTitle(ArticleTitleDataParam param);

    Result deleteArticleTitle(ArticleTitleDataParam param);

    Result saveArticleEntry(ArticleLawEntryParam param);

    Result deleteArticleEntry(ArticleLawEntryParam param);

    Result saveArticleSpecialAnnotation(ArticleSpecialAnnotationDataParam param);

    Result deleteArticleSpecialAnnotation(ArticleSpecialAnnotationDataParam param);

    Result saveArticleImage(ArticleImageParam param);

    Result deleteArticleImage(ArticleImageParam param);

    Result updateArticleData(ArticleParam param, Users users);

    Result deleteArticleData(ArticleParam param, Users users);

    Result deleteMineArticleData(ArticleParam param, Users users);

    Result updateArticleStatus(ArticleAuditDataParam param, Users users);

    Result loadArticleMaxAudioIssue(ArticleInfoParam articleInfoParam);

    Result loadLawArticleList(LawArticleListParam param);

    Result loadArticleListBySelect(ArticleListParam param, Users users);

    Result loadArticleReleaseList(ArticleDataParam param, Users users);

    Result loadArticlePromoterList();

    Result loadArticleHistory(ArticleListParam param);

    Result uploadAttachment(MultipartFile file, String uid);

    Result batchUploadAttachment(MultipartFile[] files);

    Result deleteAttachment(AttachmentParam attachmentParam);

    Result deleteArticleFromRecycle(String[] articleIds);

    Result deleteArticleFromRecycle(String articleId);

    Result restoreArticleFromRecycle(String[] articleIds);

    Result restoreArticleFromRecycle(String articleId);

    Result clearArticleFromRecycle();

    Result addArticleKeywords(List<ArticleKeywordParam> param);

    Result deleteArticleKeywordByIds(ArticleKeywordParam param);

    Result editArticleKeywords(ArticleKeywordParam param);

    Result findArticleKeywords(ArticleKeywordParam param);

    String loadArticlePreviewData(String articleId);

    Article loadArticle(String articleId);

    List<ArticleStatisticsDay> queryArticleStatisticsDayByTime(Date startTime, Date endTime, int limit);

    int deleteArticleStatisticsByTime(Date historyTime);

    Article saveArticleData(String articleId, String articleUserId, String articleTitle, String articleAuthor, Integer articlePromoterStatus,
                            String articlePromoter, String articleScout, String articleEditor, String articleSource, String articleKeyWord,
                            Integer articlePaperStatus, Integer articleWeChatStatus, Integer articleEBookStatus, Integer articleOutLinkStatus,
                            String articleOutLink, Integer articleInfoStatus, String articleInfo, Integer articleAnnotationStatus,Integer articleType, Integer articleLikeRecommendStatus,
                            Integer articleRecommendType, String articleRecommend, Integer articleVip, Integer articleVipType, Integer articleMoney, Integer articlePrice,
                            Integer articleLikeType, Integer articleLikeCount, String articleCommentId, Integer articleCommentStatus, Integer articleStatus, String publicTime,
                            Integer articleVideoStatus, Integer articleIsOriginal);

    int updateArticleData(String articleId, String articleUserId, String articleTitle, String articleAuthor, Integer articlePromoterStatus,
                          String articlePromoter, String articleScout, String articleEditor, String articleSource, String articleKeyWord,
                          Integer articlePaperStatus, Integer articleWeChatStatus, Integer articleEBookStatus, Integer articleOutLinkStatus,
                          String articleOutLink, Integer articleInfoStatus, String articleInfo, Integer articleAnnotationStatus,Integer articleType,Integer articleLikeRecommendStatus,
                          Integer articleRecommendType, String articleRecommend, Integer articleVip, Integer articleVipType, Integer articleMoney,
                          Integer articlePrice, Integer articleLikeType, Integer articleLikeCount,
                          String articleCommentId, Integer articleCommentStatus, Integer articleStatus, String publicTime,
                          Integer articleVideoStatus , Integer articleIsOriginal);



    int updateArticleUrl(String articleId, String url);

    Result<List<ArticleList>> findArticleByKeywordId(Integer articleId);

    void setArticlesLabelAndImg(List<ArticleList> articleList);

    Result<PageInfo<ArticleList>> findArticleByParam(ArticleDynamicParam param);

    /** 前台接口
     *
     * @param pram
     * @return
     */
    Result loadHotSearchArticle(FontArticlePram pram);

    Result loadSpecialArticleList(FontArticlePram pram);

    Result<PageInfo<ArticleList>> findArticleListByPlateId(FontArticlePram pram);

    int saveArticleClick(String articleId);

    int saveArticleClickPhone(String articleId);

    Result saveArticleClickCount(FontArticlePram pram);

    Result<PageInfo<ArticleStatistics>> findArticleStatisticsByParam(FontArticlePram pram);

    Result<PageInfo<ArticleList>> findLabelArticle(LabelArticleParam param);

    Result<PageInfo<ArticleList>> findArticleAtlasByParam(FontArticlePram pram);

    Result<PageInfo<ArticleList>> findArticleAudioByParam(FontArticlePram pram);

    Result<ChannelTdkVO> findArticleDynamicTdk(ArticleTdkParam param);


    //稿件库回收站相关操作接口





    List<Article> listArticleInRecycle();

    Result listArticleByArticlePromoter(Integer articlePromoterId, Integer pageNum, Integer pageSize);

    Result listMyCollectionArticle(String userId, Integer pageNum, Integer pageSize);

    Result<List<KeyValueVO>> findAllArticleLabel();



    Result loadArticleMobileInfo(FontArticlePram pram);

    ArticleKeyword selectKeywordByPrimaryKey(Integer id);

    int getArticleCountByArticlePromoter(Integer articlePromoterId);

    List<ArticleKeyword> findArticleKeywordsByIds(int[] ids);

    List<Article> listLatestArticleByArticlePromoter(Integer articlePromoterId);

    Result<Integer> findArticleKeywordsNumQuery(ArticleKeywordParam param);

    List<String> loadArticleListByType(Integer articleType);

    List<Article> loadArticleDisposeList(Integer limit);

    void updateArticleDisposeStatus(String articleId);

    List<ChannelDataMobile> loadKeywordMobileList(List<String> keywords);

    ArticleKeyword getArticleKeywordByKeyword(String keyword);

    int saveArticleStatisticsDay(ArticleStatisticsDay articleStatisticsDay);

    List<Article> loadArticleListBySubstation(Integer substationId);

    int deleteArticle(String articleId);
}
